package model;

import java.util.ArrayList;

public class Player {
	
	private int chips, seat, chipsOnTable;
	private boolean hasButton;
	ArrayList<Card> hand;
	
	
	public Player(int seat, int chips){
		this.chips = chips;
		this.seat = seat;
		this.hasButton = false;
		chipsOnTable = 0;
		this.hand = new ArrayList<Card>(); 
	}

	
	
	public void addChips(int amount){
		chips+=amount;
	}
	
	public int getChipsOnTable(){
		return chipsOnTable;
	}
	
	public void takeChipsOnTable(){
		chipsOnTable = 0;
	}
	
	public int removeChips(int amount){
		if(amount > chips){
			amount = chips;
		}		
		chips-=amount;
		chipsOnTable += amount;
		return amount;
	}
	
	public int getChips(){
		return chips;
	}
	
	public boolean hasButton(){
		return hasButton;
	}
	
	public void giveButton(){
		this.hasButton = true;
	}
	
	public void takeButton(){
		this.hasButton = false;
	}
	
	public int getSeat(){
		return seat;
	}
	
	public ArrayList<Card> getHand(){
		return hand;
	}
	
	public void dealCard(Card card){
		hand.add(card);
	}
	
	public void takeHand(){
		hand.clear();
	}
	
}
